/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseCommentEntity.cs
*        创建系统时间:       2012/11/2 19:07:02
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;

    [Serializable]
    public class BaseCommentEntity
    {
        public string CategoryID = string.Empty;
        public string Content = string.Empty;
        public string CreateDate = string.Empty;
        public string CreateUserID = string.Empty;
        private string createUserRealname = string.Empty;
        public string Description = string.Empty;
        public bool Enabled;
        public string FunctionID = string.Empty;
        public string ID = string.Empty;
        public bool Important;
        public string IPAddress = string.Empty;
        public bool IsNew;
        public string ModifyDate = string.Empty;
        public string ModifyUserID = string.Empty;
        public string ObjectID = string.Empty;
        public string OrganizeID = string.Empty;
        public string ParentID = string.Empty;
        public string PriorityID = string.Empty;
        public string ReceiverID = string.Empty;
        public string SortCode = string.Empty;
        public string Title = string.Empty;
        public bool Worked;

        public void ClearProperty()
        {
            this.ID = string.Empty;
            this.ParentID = string.Empty;
            this.OrganizeID = string.Empty;
            this.FunctionID = string.Empty;
            this.CategoryID = string.Empty;
            this.ObjectID = string.Empty;
            this.Title = string.Empty;
            this.Content = string.Empty;
            this.IsNew = false;
            this.Worked = false;
            this.PriorityID = string.Empty;
            this.Important = false;
            this.ReceiverID = string.Empty;
            this.IPAddress = string.Empty;
            this.Enabled = false;
            this.SortCode = string.Empty;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyDate = string.Empty;
        }

        public BaseCommentEntity GetFrom(DataRow dataRow)
        {
            this.ID = dataRow[BaseCommentTable.FieldID].ToString();
            this.ParentID = dataRow[BaseCommentTable.FieldParentID].ToString();
            this.OrganizeID = dataRow[BaseCommentTable.FieldOrganizeID].ToString();
            this.FunctionID = dataRow[BaseCommentTable.FieldFunctionID].ToString();
            this.CategoryID = dataRow[BaseCommentTable.FieldCategoryID].ToString();
            this.ObjectID = dataRow[BaseCommentTable.FieldObjectID].ToString();
            this.Title = dataRow[BaseCommentTable.FieldTitle].ToString();
            this.Content = dataRow[BaseCommentTable.FieldContent].ToString();
            this.Worked = dataRow[BaseCommentTable.FieldWorked].ToString() == "1";
            this.PriorityID = dataRow[BaseCommentTable.FieldPriorityID].ToString();
            this.Important = dataRow[BaseCommentTable.FieldImportant].ToString() == "1";
            this.ReceiverID = dataRow[BaseCommentTable.FieldReceiverID].ToString();
            this.IPAddress = dataRow[BaseCommentTable.FieldIPAddress].ToString();
            this.Enabled = dataRow[BaseCommentTable.FieldEnabled].ToString() == "1";
            this.SortCode = dataRow[BaseCommentTable.FieldSortCode].ToString();
            this.Description = dataRow[BaseCommentTable.FieldDescription].ToString();
            this.CreateUserID = dataRow[BaseCommentTable.FieldCreateUserID].ToString();
            this.CreateDate = dataRow[BaseCommentTable.FieldCreateDate].ToString();
            this.ModifyUserID = dataRow[BaseCommentTable.FieldModifyUserID].ToString();
            this.ModifyDate = dataRow[BaseCommentTable.FieldModifyDate].ToString();
            return this;
        }

        public string CreateUserRealname
        {
            get
            {
                return this.createUserRealname;
            }
            set
            {
                this.createUserRealname = value;
            }
        }
    }
}